import { createRouter, createWebHistory } from "vue-router";

export default createRouter({
  history:createWebHistory(),
  routes:[
    {
      path:'/home',
      component:()=>import('@/page/Home/index.vue'),
      meta:{
        title:'首页'
      }
    },
    {
      path:'/hospital',
      component:()=>import ('@/page/Hospital/index.vue'),
      children:[
        {
          path:'schedule',
          component:()=>import('@/page/Hospital/register/schedule.vue')
        },
        {
          path:'booking',
          component:()=>import('@/page/Hospital/booking/index.vue')
        },
        {
          path:'register',
          component:()=>import('@/page/Hospital/register/index.vue'),
          meta:{
            title:'预约挂号'
          }
        },
        {
          path:'close',
          component:()=>import('@/page/Hospital/Close/index.vue'),
          meta:{
            title:'停诊信息'
          }
        },
        {
          path:'notice',
          component:()=>import('@/page/Hospital/notice/index.vue'),
          meta:{
            title:'预约通知'
          }
        },
        {
          path:'detail',
          component:()=>import('@/page/Hospital/detail/index.vue'),
          meta:{
            title:'医院详情'
          }
        },

        {
          path:'search',
          component:()=>import('@/page/Hospital/search/index.vue'),
          meta:{
            title:'查询'
          }
        }
      ]
    },
    {
      path:'/user',
      component:()=>import('@/page/User/index.vue'),
      children:[
        {
          path:'certification',
          component:()=>import('@/page/User/certification/index.vue'),
          meta:{
            title:'实名认证'
          }
        },
        {
          path:'order',
          component:()=>import('@/page/User/order/index.vue'),
          meta:{
            title:'挂号订单'
          }
        },{
          path:'feedback',
          component:()=>import('@/page/User/feedback/index.vue'),
          meta:{
            title:'信息反馈'
          }
        },
        {
          path:'profile',
          component:()=>import('@/page/User/profile/index.vue'),
          meta:{
            title:'账号信息'
          }
        },
        {
          path:'patient',
          component:()=>import('@/page/User/patient/index.vue'),
          meta:{
            title:'就诊人管理'
          }
        },
        {
          path:'patient/add',
          component:()=>import('@/page/User/patient/add/index.vue'),
          meta:{
            title:'添加就诊人'
          }
        },
        {
          path:'order/show',
          component:()=>import('@/page/User/order/show/index.vue')
        },
        {
          path:'patient/show',
          component:()=>import('@/page/User/patient/show/index.vue')
        }
      ]
    },
    {
      path:'/',
      redirect:'/home'
    }
  ],
    scrollBehavior() {
      return {
        left:0,
        top:0
      }
    }
})
